(bug 1433) Add meta-information to pages with language links.
authorAndrew Garrett <werdna@users.mediawiki.org>
Fri, 23 Jan 2009 02:11:20 +0000 (02:11 +0000)
committerAndrew Garrett <werdna@users.mediawiki.org>
Fri, 23 Jan 2009 02:11:20 +0000 (02:11 +0000)
includes/OutputPage.php
languages/messages/MessagesEn.php

index 94742e7..2af993a 100644 (file)
@@ -1541,6 +1541,20 @@ class OutputPage {
                        $tags[] = Xml::element( 'link', $tag );
                }
 
+               // Language Links
+               global $wgContLang;
+               $langLinks = $this->getLanguageLinks();
+               foreach( $langLinks as $link ) {
+                       $t = Title::newFromText( $link );
+                       $tags[] = Xml::element( 'link', array(
+                                       'title' => wfMsg( 'language-link-title', $wgContLang->getLanguageName( $t->getInterwiki() ) ),
+                                       'rel' => 'alternate',
+                                       'lang' => $t->getInterwiki(),
+                                       'hreflang' => $t->getInterwiki(),
+                                       'href' => $t->getFullURL()
+                               ) );
+               }
+
                if( $wgFeed ) {
                        global $wgTitle;
                        foreach( $this->getSyndicationLinks() as $format => $link ) {
index b624c21..ac22775 100644 (file)
@@ -3791,4 +3791,5 @@ Enter the filename without the "{{ns:file}}:" prefix.',
 
 #Put all regex fragments above this line. Leave this line exactly as it is</pre>',
 
+'language-link-title' => '$1 version',
 );